package com.dinzeer.legendreliclib.lib.key;

public enum SpecialKeyType {
    KEY_1(0, "key1"),
    KEY_2(1, "key2"),
    KEY_3(2, "key3"),
    KEY_4(3, "key4"),
    KEY_5(4, "key5");
    
    private final int index;
    private final String name;
    
    SpecialKeyType(int index, String name) {
        this.index = index;
        this.name = name;
    }
    
    public int getIndex() {
        return index;
    }
    
    public String getName() {
        return name;
    }
    
    public static SpecialKeyType fromIndex(int index) {
        for (SpecialKeyType type : values()) {
            if (type.index == index) {
                return type;
            }
        }
        return KEY_1;
    }
}